package com.jz.netthings.core.controller;

import com.jz.netthings.core.service.DemoService;
import com.jz.netthings.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;

/**
 * @author yyy
 * @ClassName AdscmCoreController
 * @Description TODO
 * @date 2018/8/6 15:07
 */
@RestController
public class AdscmCoreController {

    @Autowired
    DemoService demoService;

    @RequestMapping("/exception/response")
    public SimpleCoreResponse exceptionResp(HttpServletRequest request)throws Exception{
        String eMsg = request.getParameter("eMsg");
        return new SimpleCoreResponse("501", URLDecoder.decode(eMsg,"UTF-8"),null);
    }
    @RequestMapping("/abc/aa")
    public SimpleCoreResponse abc()throws Exception{
        demoService.querAll();
        return new SimpleCoreResponse("501", URLDecoder.decode("abc","UTF-8"),null);
    }
}
